Open
Conversation
KubEF
reviewed
Dec 18, 2025
Collaborator
KubEF
left a comment
There was a problem hiding this comment.
Поправляли CI, поправляли, а он всё равно лежит. На будущее: не надо коммитить что-то после запроса ревью в кр, это против правил. Здесь я понимаю, что вы более или менее в срок это делали, но вообще-то за такое можно и 0 схлопотать
Comment on lines
+12
to
+26
| def walker_scheme(self): | ||
| barrier = 0 | ||
| for i in range(len(self.probabilities) - 1): | ||
| if self.probabilities[i][1] < self.probabilities_walker[i][1]: | ||
| self.probabilities_walker[i][1] = self.probabilities[i][1] + barrier | ||
| self.probabilities_walker[i + 1][1] += (self.probabilities_walker[i][1] - self.probabilities[i][1]) | ||
| barrier = self.probabilities_walker[i][1] | ||
| elif self.probabilities[i][1] > self.probabilities_walker[i][1]: | ||
| self.probabilities_walker[i][1] = self.probabilities[i][1] + barrier | ||
| self.probabilities_walker[i + 1][1] -= (self.probabilities[i][1] - self.probabilities_walker[i][1]) | ||
| barrier = self.probabilities_walker[i][1] | ||
| elif self.probabilities[i][1] == self.probabilities_walker[i][1]: | ||
| self.probabilities_walker[i][1] += barrier | ||
| barrier = self.probabilities_walker[i][1] | ||
| self.probabilities_walker[-1][1] += barrier |
Collaborator
There was a problem hiding this comment.
Этот код почти невозможно читать. Вы тут используете очень много раз одно и то же, неужели вы не понимаете выгоды от того, чтобы обозначить это за новую переменную?? Это и эффективнее по времени, и лучше для понимания, и уменьшает шанс ошибки
Comment on lines
+31
to
+33
| for i in self.probabilities_walker: | ||
| if probability <= i[1]: | ||
| return i[0] |
Collaborator
There was a problem hiding this comment.
Ну и смысл тогда от схемы Уолкера, если тут по итогу всё равно цикл?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.